UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e89u5z106bOGYyqIYbubMBBPLbBQBucO6cHKW6EPOD4='
WHERE
key_id = '4f597046c73c9bdfb20e002436a860b60648c6fd9446cddee012f5873a131f26'
AND (
token = 'e89u5z106bOGYyqIYbubMBBPLbBQBucO6cHKW6EPOD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)