UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SvBKwDOkoD9g2iifry8mSpXhKywipA0vHWAvqemDZ8o='
WHERE
key_id = 'fc0d853fceb2620a23675d5219a91432c96e49ea3de79b19f9a59a4db76b169b'
AND (
token = 'SvBKwDOkoD9g2iifry8mSpXhKywipA0vHWAvqemDZ8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)