UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9outkTlxLZKPoIPslONs+TGEgGkEmA+TLw/Z4zeBdQY='
WHERE
key_id = 'dadb421b41b0dd8f7009cfb860008017fee9909495ac928753e9d9197a53edf7'
AND (
token = '9outkTlxLZKPoIPslONs+TGEgGkEmA+TLw/Z4zeBdQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)