UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f5hL7E6tv6CiSUg99u2Z5yPaNuc1Qk67EXlpYRZhN44='
WHERE
key_id = '716686cb8f1cdf026ae82e3dc9c53b86b08cdf779dd91fbb4398f2de50c07312'
AND (
token = 'f5hL7E6tv6CiSUg99u2Z5yPaNuc1Qk67EXlpYRZhN44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)