UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ffwo7kuUJETwChxo7rwlUMhYiLUtKxUP2XbtSlDX+Sg='
WHERE
key_id = 'cd7a529e2dbfa896052bc3fdcf47818329c31e1e21d5f9eef70a2c2305c702ad'
AND (
token = 'Ffwo7kuUJETwChxo7rwlUMhYiLUtKxUP2XbtSlDX+Sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)