UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GffKoUgnn+T/3MAHb1gsAa6HSOTGD+qwfC4m59AjMPM='
WHERE
key_id = '1ac974b949652e2486c1898be758068b422783715913a166204ceadf7e24963f'
AND (
token = 'GffKoUgnn+T/3MAHb1gsAa6HSOTGD+qwfC4m59AjMPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)