UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9MR+VshXyV/ZHBGZDetdgZzH2Nu0ufQCFKQGSjSHPoA='
WHERE
key_id = 'd494823e4397850afc933cbeed0bfe3e6f6e52cbba0fb28f25e94fcb599aa34b'
AND (
token = '9MR+VshXyV/ZHBGZDetdgZzH2Nu0ufQCFKQGSjSHPoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)