UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AWOyiI9EumyVXX4hag6Dkv+5mugHibyBPtbn1rT+Ycs='
WHERE
key_id = '57dcd3b09d0e7da3309e8f5d5a8a59106db17a92a7c51388dfa1e1c392a94e02'
AND (
token = 'AWOyiI9EumyVXX4hag6Dkv+5mugHibyBPtbn1rT+Ycs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)