UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VhGQ1tY9kdsVeICqrGiplnChc8mRzlDZpUjqyzY6TxA='
WHERE
key_id = '99ddb066b05edda8c395e1e2ab4c2e6c47f55f0100f607210b31d52ce8ab5232'
AND (
token = 'VhGQ1tY9kdsVeICqrGiplnChc8mRzlDZpUjqyzY6TxA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)