UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8+ZsaRsFt2sSPYY5OuZt6T2waOZ9Jxb2c6kizeRw8DY='
WHERE
key_id = '28de6106d340136a6ce0ffed4c32c89d5bf6924d69a5c99a504cc0e140d79137'
AND (
token = '8+ZsaRsFt2sSPYY5OuZt6T2waOZ9Jxb2c6kizeRw8DY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)