UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xB8UCV4DOd3VFFFTQnPeAx/Tl93sJqoRHgqfxTeGwB4='
WHERE
key_id = 'ef2f4321eefee4a3bbd23c432f10dde93699260a5a53d43bf299eae792ee3a71'
AND (
token = 'xB8UCV4DOd3VFFFTQnPeAx/Tl93sJqoRHgqfxTeGwB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)