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