UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c6woWLK5qKFxVcGaC6IAtnfqTVS6k44F3IaOL22ofhA='
WHERE
key_id = '908f08cf50f83288186a76e8a67cf10703564e49ae424605bb12633d1bd78f6e'
AND (
token = 'c6woWLK5qKFxVcGaC6IAtnfqTVS6k44F3IaOL22ofhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)