UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dgRaAAmPmaG1FEQd+64kXKn+vab9TB2us3m93rHkgVM='
WHERE
key_id = '79ba0174f0bd59952ff2181c3264ac30e0586fe2d2024b7d1e6745ac48059a7d'
AND (
token = 'dgRaAAmPmaG1FEQd+64kXKn+vab9TB2us3m93rHkgVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)