UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm5VF9K1AqqoXb+nJqzUqv00PjHmKxLclO26/PyyOvd0='
WHERE
key_id = '5d332541f16f0e9b01265b9d6926dfc625d6e81cb919698c6e73a73ec964ef4f'
AND (
token = 'm5VF9K1AqqoXb+nJqzUqv00PjHmKxLclO26/PyyOvd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)