UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U7lJWkgD4JOTY9pwgTMeDTZN4K1dK8UDOF4rj7ZQIJU='
WHERE
key_id = '2b09a758fa6eb583c8e1456082bf080d16fb4975943a4a88ccc3f2b34dede93d'
AND (
token = 'U7lJWkgD4JOTY9pwgTMeDTZN4K1dK8UDOF4rj7ZQIJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)