UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SbDq47kTTqoOIXKzXCnV+rPT4oBhub1Q+QCaEFdlEMg='
WHERE
key_id = '73896a67bd933ac2913cf2cbcb7a81467b1459395c5bdd22c1317d8683ca5b23'
AND (
token = 'SbDq47kTTqoOIXKzXCnV+rPT4oBhub1Q+QCaEFdlEMg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)