UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R7pgSzoxCFzOsr26UII9A+WKYjS/SqRTavdNKtBqy94='
WHERE
key_id = '68ec08c8811879b67686c9cab4d960a761618753eafd3dd102c300de59ad529b'
AND (
token = 'R7pgSzoxCFzOsr26UII9A+WKYjS/SqRTavdNKtBqy94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)