UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+lzkPlCFMhCU+J7lAyiQTGF1hnX3ayyxksmCGMFKug4='
WHERE
key_id = 'f52e2f255e7817e154c704faa3ef11ba8e48e516c4b60c1f76e18d4ffc32e43f'
AND (
token = '+lzkPlCFMhCU+J7lAyiQTGF1hnX3ayyxksmCGMFKug4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)