UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u+Qi/LEeHbQtW1duoPhbFCfeVYpovAJFtcp1HMnF6yA='
WHERE
key_id = 'e3d47131e65a8b846ec5a7156384736f0a91e6cfd12a10941660e6726b408645'
AND (
token = 'u+Qi/LEeHbQtW1duoPhbFCfeVYpovAJFtcp1HMnF6yA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)