UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'he8UrUYJwmTNUDj9fNAFCMkl8PDmxD4g1+gwDr0MHjA='
WHERE
key_id = '01868fd0b1161af936241195cd958ec5d130557f7ddbe94a9b6e8bab15c26c8e'
AND (
token = 'he8UrUYJwmTNUDj9fNAFCMkl8PDmxD4g1+gwDr0MHjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)