UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kPSUDL61AHl6vN9nY/lu5bq0JLpI5dJ5Saiue9N9HOc='
WHERE
key_id = '12daf2f1dda0f482679df46c5ce1dc86e701a5de1df2cc333ac45eacc7a68b3e'
AND (
token = 'kPSUDL61AHl6vN9nY/lu5bq0JLpI5dJ5Saiue9N9HOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)