UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3EFcV+TpsbWahfaxxm01L7aCOZYq3M2jIWdjOBEIAAM='
WHERE
key_id = 'a9b6855539a5794e262c657b08ad5a0f8aca5e1c93562086165b3fd748e34d5b'
AND (
token = '3EFcV+TpsbWahfaxxm01L7aCOZYq3M2jIWdjOBEIAAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)