UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UBpAsojTDmk6JOXsq2gFmTypegWLDatZEQS6K7SPSKc='
WHERE
key_id = '6f884a7c7ac5614ab450b5eb8967bc8e78ef86fb077df8bf2f380d09bfbde84b'
AND (
token = 'UBpAsojTDmk6JOXsq2gFmTypegWLDatZEQS6K7SPSKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)