UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EZ/bG6nvVp+VOaRB0G+HFgfyK31t3/16AHM1OQH7ur0='
WHERE
key_id = 'd995f9ad50367fd9cde2ee347e1cb474a3c1ea34cc233d05402bea009e54dcf1'
AND (
token = 'EZ/bG6nvVp+VOaRB0G+HFgfyK31t3/16AHM1OQH7ur0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)