UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Ogmib7NrKMQECZqDfi3aVAdlOg0v8RH3nFQiomMDWM=' 
WHERE 
  key_id = '8a91f2da124b031d7ed8fcf10cf5582c09f48b77a34bb3242f078b0fd9ed2af5' 
  AND (
    token = '2Ogmib7NrKMQECZqDfi3aVAdlOg0v8RH3nFQiomMDWM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044