UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aZ0jGb/jmpeNjFmPDUFLmGez19EdwG3MHVFzuIdz09A='
WHERE
key_id = '35e0442bab831f5a160085cb7fdf59a52364407f1eb29c967760380cd5e07b1a'
AND (
token = 'aZ0jGb/jmpeNjFmPDUFLmGez19EdwG3MHVFzuIdz09A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)