UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dy5j7K9B4p3U5B7acvidNqFzE+GjiXCyy5LaPjyGNlU='
WHERE
key_id = '354b2a118a481fb412b52bc022f69460400b883303a45faf479cacc98e8b3b6f'
AND (
token = 'dy5j7K9B4p3U5B7acvidNqFzE+GjiXCyy5LaPjyGNlU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)