UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JFH4JyJhY9ECP6olRtNpgXWa2v0Nox49U0DpUlVULSw='
WHERE
key_id = 'e6c08cadde1ef93d77a474b6d73f338db10e2566f5cf26d3d612f64f814d0c10'
AND (
token = 'JFH4JyJhY9ECP6olRtNpgXWa2v0Nox49U0DpUlVULSw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)