UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ECPxP6RFNrs6/AMZqCFqG8EpRbqQ4Q5LIaB8MnmlGBw=' 
WHERE 
  key_id = 'aa03b81ab0f4d8f685e8ed3bdfd605b9b191366d8e1ed3e58a3f1254736eabb8' 
  AND (
    token = 'ECPxP6RFNrs6/AMZqCFqG8EpRbqQ4Q5LIaB8MnmlGBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040