UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NFqhwiUg+XxUPQ6wvP7TiG63IY++LMwNVk+Fk8cWv4Y='
WHERE
key_id = '19d3b674de2f4a5cdeeb8c0cd164e569d964c3ae5613c6d35cea3eec5066ea4e'
AND (
token = 'NFqhwiUg+XxUPQ6wvP7TiG63IY++LMwNVk+Fk8cWv4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)