UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oBYraySdIjV5xVV/1JHYENtYZ4nbLItHq3/X1wj/4N8='
WHERE
key_id = '6bd95d1bfab242e6554e59be358ef94ce489462da8dab4cd0762c66ccbdf9386'
AND (
token = 'oBYraySdIjV5xVV/1JHYENtYZ4nbLItHq3/X1wj/4N8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)