UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M0A0SRLm0Psju2Xa7NLUVwYTNDzckf9zRLbjxH85JL4='
WHERE
key_id = '951feb8750490d90eee2b8751be125d32e69022fded716ec772a7a294b3c2010'
AND (
token = 'M0A0SRLm0Psju2Xa7NLUVwYTNDzckf9zRLbjxH85JL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)