UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm4rA6ExMds2P5m2o5Y9faMomy4RHrTxjPEz/s1/4/2k='
WHERE
key_id = '098672c67d3dee31316c9c4902a09b497a95aa3cb2c744d322d3ebea99e1eff9'
AND (
token = 'm4rA6ExMds2P5m2o5Y9faMomy4RHrTxjPEz/s1/4/2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)