UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4M+Xu2z6uFwUZMZFaqB4DP8IHjY9IWSd/MjCEOiKuHw='
WHERE
key_id = 'c0e8b486a6c84df01a25ce1b602c94be2497801b9349b6bc8c2b47807dcd7fbd'
AND (
token = '4M+Xu2z6uFwUZMZFaqB4DP8IHjY9IWSd/MjCEOiKuHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)