UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4HgFH61RquYXTR3BFDdGFp6QAhnpxYl7m7M3aO2Mtec=' 
WHERE 
  key_id = '62e7f9d17e2d6e32c30d0591140ad497f16c364192c39f1825fcaf10fc69e58f' 
  AND (
    token = '4HgFH61RquYXTR3BFDdGFp6QAhnpxYl7m7M3aO2Mtec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032