UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LnA/Pnrfqafm2FNVO7RmfLLH6DnMw+1v50sG9EFJFDk='
WHERE
key_id = 'd1851a2702e23b9efb9f5aacc93cfbdba084276815a30be2b03467a57c19a6c1'
AND (
token = 'LnA/Pnrfqafm2FNVO7RmfLLH6DnMw+1v50sG9EFJFDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)