UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y720WcgkO8VkbwMdq79FZKa7CYFEONtxZ5ToeM4RrM0='
WHERE
key_id = '36fd5673fc708b066f5404a1b38bd37fa7f556aeacea57f8f8ba4aeef705b688'
AND (
token = 'y720WcgkO8VkbwMdq79FZKa7CYFEONtxZ5ToeM4RrM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)